package com.woniuxy.movie.product.client;

import com.woniuxy.movie.commons.core.model.Result;
import com.woniuxy.movie.product.client.dto.HallDto;
import com.woniuxy.movie.product.dto.seat.SeatDto;
import org.springframework.cloud.openfeign.FeignClient;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestParam;

import java.util.List;
import java.util.Set;

@FeignClient(name = "cinema-service",path = "/cinema")
public interface CinemaClient {

    /**
     * 通过多个ID查询影厅信息
     * @param ids
     * @return
     */
    @PostMapping("/cinemaHall/selIds.api")
    Result<List<HallDto>> selHallIds(@RequestBody Set<Integer> ids);

    @GetMapping("/cinemaSeat/selNormal.api")
    Result<List<SeatDto>> selSeatNormal(@RequestParam("hallId") Integer hallId);

    /**
     * 查询多个影厅的可用座位
     * @param ids
     * @return
     */
    @PostMapping("/cinemaSeat/byNormalIds.api")
    public Result<List<SeatDto>> byNormalSeatIds(@RequestBody Set<Integer> ids);
}
